package com.example.tcp.server.example;

import com.example.tcp.server.Client;
import com.example.tcp.server.Frame;
import io.netty.buffer.ByteBufUtil;
import io.netty.channel.Channel;
import io.netty.util.AsciiString;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class ExampleClient extends Client {
    public ExampleClient(AsciiString deviceId, Channel channel) {
        super(deviceId, channel);
    }

    @Override
    protected void onRecvFrame(Frame frame) {
        log.info(ByteBufUtil.hexDump(frame.content()));
    }

    @Override
    public void onClientDisconnect() {
        log.info("client disconnect: {}", this.getDeviceId());
    }
}
